<?php
		// 验证用户是否登录
	require_once 'session-check.php';
	$user = $_SESSION['login_user'];
?>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>站点管理-管理评论</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<link rel="stylesheet" type="text/css" href="../style/admin.css"/>
	</head>
	<body>
		<div class="head">
			站点后台管理  [<a href=".." style="font-color:white">返回站点</a>]
		</div>
		<div class="userinfo">
		当前登录用户:
		<?php 
			echo $user;
			echo ' [<a href="user-action.php?action=logout">注销登陆</a>]';
		?>
		</div>
		<div class="container">
			<div class="left">
				<h1>功能列表</h1>
				<ul>
					<li>管理用户</li>
					<li><a href="post-admin.php">管理文章</a></li>
					<li><a href="feedback-admin.php">管理评论</a></li>
				</ul>
			</div>
			<div class="right">
			<?php
				require_once '../util/dbconnection.php';
				
				$userobj = retrive_user_info( $user );
			?>
			<h1>用户管理</h1>
			<ul>
			<li>编辑用户信息</li>
			</ul>
			<form action="user-action.php?action=update" method="post" id="userform">
				<table border="1" cellspacing="0"  cellpadding="5px">
				<tr>
					<td><label>用户名:</label></td>
					<td><?php echo $user;?></td>
				</tr>
				<tr>
					<td><label>昵称:</label></td>
					<td><input type="text" name="nickname" id="nickname" value="<?php echo $userobj['nick_name'];?>" size="22" tabindex="2" /></td>
				</tr>
				<tr>
					<td><label>邮箱:</label></td>
					<td><input type="text" name="email" id="email" value="<?php echo $userobj['email'];?>" size="22" tabindex="2" /></td>
				</tr>
				<tr>
					<td><label>新密码:</label></td>
					<td><input type="password" name="newpwd1" id="newpwd1" value="" size="22" tabindex="2" /></td>
				</tr>
				<tr>
					<td><label>新密码确认:</label></td>
					<td><input type="password" name="newpwd2" id="newpwd2" value="" size="22" tabindex="2" /></td>
				</tr>
				</table>
				<input name="submit" type="submit" id="submit" tabindex="5" value="更新" />
			</form>
			</div>
		</div>	
	</body>
</html>
	